|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnl.ivojonker.icn.configuration.Configuration
public class Configuration
Manages the creation and retrieval of properties from the (within .jar) configured datasource/tablename.
Requires a websphere-application server context as it looks up datasources using the com.ibm.websphere.naming.WsnInitialContextFactory
| Field Summary | |
|---|---|
private static Configuration |
_instance
|
private java.util.ArrayList<ConfigurationEntry> |
config
|
private static java.lang.String |
CONFIGTABLENAME
|
private static java.lang.String |
CREATETABLEQUERY
|
private static java.lang.String |
DATASOURCEJNDI
|
static java.lang.String |
DB_COL_DESCRIPTION
|
static java.lang.String |
DB_COL_EVALFRONTEND
|
static java.lang.String |
DB_COL_EXPOSEFRONTEND
|
static java.lang.String |
DB_COL_KEY
|
static java.lang.String |
DB_COL_VALUE
|
private java.util.Properties |
flatConfiguration
|
private static java.util.logging.Logger |
logger
|
| Constructor Summary | |
|---|---|
private |
Configuration()
When creating the instance, search the config.properties for the datasource/table name to use. |
| Method Summary | |
|---|---|
void |
createTable()
|
void |
dropTable()
drops the configuration table. |
private javax.sql.DataSource |
getConfigDS()
Looks up the datasource in the websphere context. |
static Configuration |
getInstance()
Gets an instance from the database; will use cache. |
static Configuration |
getInstance(boolean useCache)
Gets an instance from the database; will use cache. |
static Configuration |
getInstanceSupressExceptions(boolean useCache)
Always returns a functional ConfigurationObject, even if exceptions occur. |
java.lang.String |
getProperty(java.lang.String canonicalPropertyName)
Retrieves a property from the instance; will result null if property not present. |
java.lang.String |
getProperty(java.lang.String canonicalPropertyName,
java.lang.String valueIfNullOrNotPresent)
Retrieves a property from the instance |
protected java.util.ArrayList<ConfigurationEntry> |
getRawConfig()
|
protected void |
persist(java.util.ArrayList<ConfigurationEntry> props)
Persists a set of key/values to the database. |
private void |
refreshConfigFromDB()
Queries the database. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static java.util.logging.Logger logger
private static java.lang.String DATASOURCEJNDI
private static java.lang.String CONFIGTABLENAME
private static java.lang.String CREATETABLEQUERY
private static Configuration _instance
public static final java.lang.String DB_COL_KEY
public static final java.lang.String DB_COL_VALUE
public static final java.lang.String DB_COL_EXPOSEFRONTEND
public static final java.lang.String DB_COL_EVALFRONTEND
public static final java.lang.String DB_COL_DESCRIPTION
private java.util.Properties flatConfiguration
private java.util.ArrayList<ConfigurationEntry> config
| Constructor Detail |
|---|
private Configuration()
| Method Detail |
|---|
public static Configuration getInstance(boolean useCache)
throws java.sql.SQLException
useCache - Forces a database roundtrip; updates the current classloader's cache.
java.sql.SQLException
public static Configuration getInstance()
throws java.sql.SQLException
java.sql.SQLExceptionpublic static Configuration getInstanceSupressExceptions(boolean useCache)
useCache -
private void refreshConfigFromDB()
throws java.sql.SQLException
java.sql.SQLExceptionprivate javax.sql.DataSource getConfigDS()
JNDIName -
protected void persist(java.util.ArrayList<ConfigurationEntry> props)
throws java.sql.SQLException
props -
java.sql.SQLException
public void createTable()
throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getProperty(java.lang.String canonicalPropertyName,
java.lang.String valueIfNullOrNotPresent)
canonicalPropertyName - valueIfNullOrNotPresent -
public java.lang.String getProperty(java.lang.String canonicalPropertyName)
canonicalPropertyName -
protected java.util.ArrayList<ConfigurationEntry> getRawConfig()
public void dropTable()
throws java.sql.SQLException
java.sql.SQLException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||